home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++
- Path: in2.uu.net!world!bobduff
- From: bobduff@world.std.com (Robert A Duff)
- Subject: Re: C/C++ knocks the crap out of Ada
- Message-ID: <DoBIoL.1JC@world.std.com>
- Organization: The World Public Access UNIX, Brookline, MA
- References: <JSA.96Feb16135027@organon.com> <4hf701INNdl7@keats.ugrad.cs.ubc.ca> <4hm6lo$eln@fred.netinfo.com.au> <4hml8s$a1q@solutions.solon.com>
- Date: Fri, 15 Mar 1996 16:48:20 GMT
-
- In article <4hml8s$a1q@solutions.solon.com>,
- Peter Seebach <seebs@solutions.solon.com> wrote:
- >Certainly. A C implementation is free to be an interpreter that emulates
- >every bit of every value and checks for arbitrary programming errors.
- >
- >There is no restriction that an implementation may not offer range checking,
- >and many already do have stricter type checking than the standard requires.
-
- But C doesn't have any syntax for defining the range of an int, except:
-
- int x; /* x is always between 1 and 10 */
-
- So how can a C implementation check this range, without extending the
- syntax of the language? There are many other examples.
-
- It is true that a C implementation can check array bounds without
- extending the language. But it's quite expensive at run time, because
- of the confusion between pointers and arrays.
-
- - Bob
-